﻿using AutoMapper;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using WMS.FC.Domain.DomainObject.System;
using WMS.FC.Domain.Service.System;
using WMS.FC.Domain.Service.System.Interface;

namespace WMS.FC.Infrastructure.Common
{
    public class ApiHelper : IApiHelper
    {
        protected readonly ILogger<ServiceBase> logger;
        protected readonly IOptions<WmsSettings> options;
        protected readonly IMapper mapper;
        protected readonly IHttpClientFactory httpClientFactory;

        public ApiHelper(ILogger<ServiceBase> logger, IOptions<WmsSettings> options, IMapper mapper, IHttpClientFactory httpClientFactory)
        {
            this.logger = logger;
            this.options = options;
            this.mapper = mapper;
            this.httpClientFactory = httpClientFactory;
        }

        public async Task<ActionResult<T>> Call<T>(string api, object data) where T : class, new()
        {
            var result = new ActionResult<T>();
            try
            {


            }
            catch (Exception ex)
            {
                return result.Exception(ex);
            }

            return result;
        }
    }
}
